package com.rfs.dto;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author renfushuai
 * @date 2021/9/14
 */
@Data
@Accessors(chain = true)
public class UserDto {
    private Long id;
    private String name;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date birthday;
    private BigDecimal amount;
    private Boolean isValid;
    private Integer age=0;

    public static void main(String[] args) {
        TestValidDto testValidDto = new TestValidDto();
        testValidDto.setAmount(100);
        UserDto userDto = BeanUtil.copyProperties(testValidDto, UserDto.class);
    }
}
